const CODE = {
    Success: '00000',
    Close: "00002",
    Timeout: '00003',
    FatalError: '00004',
    DeviceError: '00005',

    // IDCard
    CardInvalid: "00006",  // 无效卡
    CardAcceptCancelled: "00007", // 用户取消
    CardInserted: "00008", // 插入卡
    CardDataError: "00009", //身份证数据错误

    // Barcode
    ReadBarcodeCancelled: "00010"
};

const OPEN_MODULE = [
    { OpenCompleted: CODE.Success },
    { ConnectionOpened: CODE.Success },
    { Timeout: CODE.Timeout },
    { FatalError: CODE.FatalError },
    { DeviceError: CODE.DeviceError },
]

const READ_IDCARD = [
    { CardAccepted: CODE.Success },
    { CardInserted: CODE.CardInserted },
    { CardInvalid: CODE.CardInvalid },
    { CardAcceptCancelled: CODE.CardAcceptCancelled },
    { FatalError: CODE.FatalError },
    { DeviceError: CODE.DeviceError },
]

const READ_BCR = [
    { BarcodeRead: CODE.Success },
    { Timeout: CODE.Timeout },
    { ReadBarcodeCancelled: CODE.ReadBarcodeCancelled },
    { FatalError: CODE.FatalError },
    { DeviceError: CODE.DeviceError },
]

const CLOSE_MOD = [
    { ConnectionClosed: CODE.Success },
    { Timeout: CODE.Timeout },
    { FatalError: CODE.FatalError },
    { DeviceError: CODE.DeviceError },
]

const MODS = {
    IDCard: "IDCard",
    Barcode: "Barcode",
}

const OPEN_STATE = {
    ConnectionOpened: "ConnectionOpened",
    DeviceError: "DeviceError",
    Timeout: "Timeout",
    FatalError: "FatalError"
}


export { MODS, OPEN_STATE, READ_IDCARD, READ_BCR, CLOSE_MOD, OPEN_MODULE }
